package kr.hkit.powerjava.chther22.work;

import java.util.ArrayList;

public class StudentManager implements DaoInterface<Student>{
	public StudentManager(ArrayList<Student> arlList) {
		this.arlList = arlList;
	}

	private ArrayList<Student> arlList;
	
	public  StudentManager(){
		arlList = new ArrayList<>();
	}
	public void addStudent(Student std){
		arlList.add(std);
	}
	public void setStudent(Student std){
		arlList.set(arlList.indexOf(std), std);
	}
	public Student searchstd(Student std){
		arlList.equals(std);
		return std;
	}
	public void delStudent(Student std){
		if(arlList.contains(std)){
			arlList.remove(arlList.indexOf(std));
		}else{
			System.out.println("해당 학생 정보 없음");
		}
	}
	public void prnList(){
		prnheader();
		for (Student std : arlList) {
			System.out.println(std);
	
		}
	}
	private static void prnheader() {
		// TODO Auto-generated method stub
		System.out.printf("%4s %4s %4s%4s %4s %4s %6.2s\n", "학번", "이름", "국어",
				"영어", "수학", "총점", "평균");

	}

}
